[gd_resource type="Shader" format=2]

[resource]
code = "shader_type canvas_item;

uniform sampler2D normal;

void fragment() {
	vec3 norm = texture(normal,UV).rgb;
	NORMAL = vec3(norm.rg*vec2(-2.0,2.0)-vec2(-1.0,1.0),norm.b);
	COLOR = texture(TEXTURE,UV);
}

void light() {
	vec3 light_vec = -normalize(vec3(-LIGHT_VEC.x,-LIGHT_VEC.y,-LIGHT_HEIGHT));

	vec3 n = normalize(NORMAL);

	float dp = dot(normalize(NORMAL),light_vec);
	LIGHT = vec4(vec3(dp),1.0)*COLOR*LIGHT_COLOR;
}"
